﻿using System;
using System.IO.IsolatedStorage;

namespace INdTFramework.Persistence.Storage
{
    public class AppSettingsStorage
    {
        private readonly IsolatedStorageSettings iso;

        public AppSettingsStorage()
        {
            iso = IsolatedStorageSettings.ApplicationSettings;
        }

        public T Get <T> (String key){
            if (iso.Contains(key))
            {
                return (T) iso[key];
            }

            return default(T);
        }

        public void Set(String key, Object data)
        {
            iso[key] = data;
        }
    }
}
